﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="EditUser.aspx.cs" Inherits="Admin_Modules_Account_EditUser" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="/js/Editor.js"></script>
    <script src="/js/jquery.js" type="text/javascript"></script>
    <link href="/css/Dialog.css" rel="stylesheet" />
    <link href="/css/Editor.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c" runat="Server">
    <table style="font-family: Verdana; font-size: 100%; width: 500px;">
        <tr>
            <td align="center" colspan="2" style="color: White; background-color: #1C5E55; font-weight: bold;">
                Sign Up for Your New Account
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="txtUserName">Full Name:</asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtUserName" runat="server" Width="250"></asp:TextBox>
                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="txtUserName"
                    ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="Label1" runat="server" AssociatedControlID="Avatar">Avatar</asp:Label>
            </td>
            <td>
                <div class="inside">
                    <div style="width: 80px; height: 80px; border: solid thin orange;">
                        <asp:ScriptManager ID="ScriptManager1" runat="server" />
                        <asp:Image ID="Avatar" runat="server" EnableViewState="true" AlternateText="Avatar"
                            ToolTip="Avatar" Width="80px" Height="80px" />
                        <asp:HiddenField ID="hdfimg" runat="server" />
                    </div>
                    <div>
                        <telerik:DialogOpener runat="server" ID="DialogOpener1"></telerik:DialogOpener>
                        <input type="button" id="btnSelectThumb" value="Chọn" style="width: 40px;" onclick="selectThumb()" />
                        <input type="button" id="btnClearThumb" value="Xóa" style="width: 40px;" onclick="clearThumb()" />
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />&nbsp;<asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
            </td>
        </tr>
    </table>
    <script type="text/javascript">


        function selectThumb() {
            var radEditorContent = $find("<%= DialogOpener1.ClientID %>");
            radEditorContent.openUrl("/Admin/Modules/FileManager/InsertFTPImage.aspx", {}, 800, 600, selectThumbComplete, null, "custom link manager", true);
        }

        function clearThumb() {
            $('#<%= Avatar.ClientID %>').attr("scr", "");
            $('#<%= hdfimg.ClientID %>').val("");
        }
        var selectThumbComplete = function (sender, args) {
            if (!args.IsCancel) {
                if (args.Url.length > 0) {
                    var img = document.getElementById("<%= Avatar.ClientID %>");
                    img.src = args.Url;
                    $('#<%= hdfimg.ClientID %>').val(args.Url);
                }
            }
        }
    </script>
</asp:Content>
